package com.ruoyi.recycle.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.recycle.domain.RecycleOrderRoyalty;
import com.ruoyi.recycle.vo.AttractDataVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface RecycleOrderRoyaltyMapper extends BaseMapper<RecycleOrderRoyalty> {
    @Select("select date_format(create_time,'%Y-%m-%d') as Date, cont(order_no) as orderCount, sum(royalty_integral) as shopDrawPercentage,sum(royalty_integral) as clientDrawPercentage, order_status as orderStatus, order_no as orderNo from recycle_order_royalty ${ew.customSqlSegment} ")
    IPage<AttractDataVO> shopDataStatistics(@Param("page") Page<RecycleOrderRoyalty> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<RecycleOrderRoyalty> wrapper);
}
